package com.study;

import com.study.config.ApplicationConfiguration;
import com.study.frame.TankWarFrame;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 坦克大战游戏的运行类
 * 该游戏的编写是为了熟练设计模式的使用
 * 会在每一个点中使用注释讲明白
 * @Author ZhuHJay
 * @Date 2021/9/13 22:36
 */
public class TankWarApplication {

    public static void main(String[] args) throws Exception {
        // 获取一个SpringIoc容器对象
        ApplicationContext app =
                new AnnotationConfigApplicationContext(ApplicationConfiguration.class);
        // 从容器中获取窗口
        TankWarFrame frame = app.getBean(TankWarFrame.class);
        frame.setVisible(true);
        while (true){
            Thread.sleep(50);
            frame.repaint();
        }
    }

}
